using System;
using System.Collections.Generic;

namespace Entity.Hibernate
{
    public class SearchCriteria
    {
        private List<SearchObj> searchObj = new List<SearchObj>();

        public SearchCriteria(Type _sClass)
        {
            SearchClass = _sClass;
        }

        public int SoBanGhi { get; set; }

        public Type SearchClass { get; set; }

        public List<SearchObj> SearchObj
        {
            get { return searchObj; }
            set { searchObj = value; }
        }

        public string OrderAtts { get; set; }

        public string OrderOpers { get; set; }

        public void addSearchItem(SearchObj sObj)
        {
            if (sObj.Name != null)
            {
                searchObj.Add(sObj);
            }
            else
            {
                throw new NullReferenceException("Name is null!");
            }
        }
    }
}